home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / share / snmp / mib2c-data / mfd-data-access.m2c < prev    next >
Encoding:
Text File  |  2007-02-07  |  4.5 KB  |  158 lines

  1. ##//#########################################################  -*- c -*-
  2. ##//generic include for XXX. Do not use directly.
  3. ##
  4. ##//$Id: mfd-data-access.m2c,v 1.12 2004/10/08 23:39:17 rstory Exp $
  5. ##//####################################################################
  6. ##//####################################################################
  7. ##
  8. ## lower conf files get confused with multiple processing types, so
  9. ## set single options
  10. @eval $mfd_data_access_processing_type = "$m2c_processing_type"@
  11. @eval $m2c_processing_type = 'h'@
  12. @open ${name}_data_access.h@
  13. @eval $hack = "Id"@
  14. /*
  15.  * Note: this file originally auto-generated by mib2c using
  16.  *       version $Revision: 1.12 $ of $RCSfile: mfd-data-access.m2c,v $
  17.  *
  18.  * $$hack:$
  19.  */
  20. @if $m2c_mark_boundary == 1@
  21. /** START code generated by $RCSfile: mfd-data-access.m2c,v $ $Revision: 1.12 $ */
  22. @end@
  23. @eval $m2c_save = "$name"@
  24. @eval $name = "${name}_DATA_ACCESS"@
  25. @include generic-header-top.m2i@
  26. @eval $name = "$m2c_save"@
  27.  
  28. /* *********************************************************************
  29.  * function declarations
  30.  */
  31.  
  32. /* *********************************************************************
  33.  * Table declarations
  34.  */
  35. @foreach $table table@
  36. @    include m2c_setup_table.m2i@
  37. @    include details-table.m2i@
  38.  
  39. @    eval $m2c_tmp=""@
  40. @    foreach $node index@
  41. @      include m2c_setup_node.m2i@
  42. @      eval $m2c_tmp="$m2c_tmp, $m2c_node_param_val"@
  43. @    end@ // for each index
  44.  
  45.     int ${context}_init_data(${context}_registration_ptr ${context}_reg);
  46.  
  47. @    include mfd-access-${m2c_table_access}-defines.m2i@
  48.     int ${context}_row_prep( ${context}_rowreq_ctx *rowreq_ctx);
  49. @end@
  50.  
  51. @eval $m2c_save = "$name"@
  52. @eval $name = "${name}_DATA_ACCESS"@
  53. @include generic-header-bottom.m2i@
  54. @eval $name = "$m2c_save"@
  55. ##//##################################################################
  56. ##//Do the .c file
  57. ##//##################################################################
  58. @eval $m2c_processing_type = 'c'@
  59. @open ${name}_data_access.c@
  60. /*
  61.  * Note: this file originally auto-generated by mib2c using
  62.  *       version $Revision: 1.12 $ of $RCSfile: mfd-data-access.m2c,v $ 
  63.  *
  64.  * $$hack:$
  65.  */
  66. @include generic-source-includes.m2i@
  67.  
  68. #include "${name}_data_access.h"
  69.  
  70. /** @defgroup data_access data_access: Routines to access data
  71.  *
  72.  * These routines are used to locate the data used to satisfy
  73.  * requests.
  74.  * 
  75.  * @{
  76.  */
  77. @foreach $table table@
  78. @    include m2c_setup_table.m2i@
  79. @    include details-table.m2i@
  80.  
  81. /**
  82.  * initialization for ${context} data access
  83.  *
  84.  * This function is called during startup to allow you to
  85.  * allocate any resources you need for the data table.
  86.  *
  87.  * @param ${context}_reg
  88.  *        Pointer to ${context}_registration
  89.  *
  90.  * @retval MFD_SUCCESS : success.
  91.  * @retval MFD_ERROR   : unrecoverable error.
  92.  */
  93. int
  94. ${context}_init_data(${context}_registration_ptr ${context}_reg)
  95. {
  96.     DEBUGMSGTL(("verbose:${context}:${context}_init_data","called\n"));
  97.  
  98.     /*
  99.      * TODO:303:o: Initialize $context data.
  100.      */
  101. @ifconf ${table}_init_data.m2i@
  102. @   include ${table}_init_data.m2i@
  103. @else@
  104. @   if $m2c_include_examples == 1@
  105. $example_start
  106.     /*
  107.      * if you are the sole writer for the file, you could
  108.      * open it here. However, as stated earlier, we are assuming
  109.      * the worst case, which in this case means that the file is
  110.      * written to by someone else, and might not even exist when
  111.      * we start up. So we can't do anything here.
  112.      */
  113. $example_end
  114. @   end@
  115.  
  116.     return MFD_SUCCESS;
  117. @end@ #ifconf
  118. } /* ${context}_init_data */
  119.  
  120. @    include mfd-access-${m2c_table_access}-defines.m2i@
  121. /**
  122.  * prepare row for processing.
  123.  *
  124.  *  When the agent has located the row for a request, this function is
  125.  *  called to prepare the row for processing. If you fully populated
  126.  *  the data context during the index setup phase, you may not need to
  127.  *  do anything.
  128.  *
  129.  * @param rowreq_ctx pointer to a context.
  130.  *
  131.  * @retval MFD_SUCCESS     : success.
  132.  * @retval MFD_ERROR       : other error.
  133.  */
  134. int
  135. ${context}_row_prep( ${context}_rowreq_ctx *rowreq_ctx)
  136. {
  137.     DEBUGMSGTL(("verbose:${context}:${context}_row_prep","called\n"));
  138.  
  139.     netsnmp_assert(NULL != rowreq_ctx);
  140.  
  141.     /*
  142.      * TODO:390:o: Prepare row for request.
  143.      * If populating row data was delayed, this is the place to
  144.      * fill in the row for this request.
  145.      */
  146.  
  147.     return MFD_SUCCESS;
  148. } /* ${context}_row_prep */
  149.  
  150. @end@
  151. ##
  152. /** @} */
  153. ##//####################################################################
  154. @if $m2c_mark_boundary == 1@
  155. /** END code generated by $RCSfile: mfd-data-access.m2c,v $ $Revision: 1.12 $ */
  156. @end@
  157. @eval $m2c_processing_type = "$mfd_data_access_processing_type"@
  158.